﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Dmg_BOSS_Enemy : MonoBehaviour
{

    Animator am;

    public Transform player;
    void Start()
    {
        am = transform.parent.GetComponent<Animator>();
    }

    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.tag.Equals("PlayerArm"))
        {
            transform.parent.GetComponent<Enemy_BOSS_Controller>().hp -= player.GetComponent<PlayerController>().atk;
        }

        if (other.gameObject.tag.Equals("PlayerWeapon"))
        {
            Destroy(other.gameObject);
            transform.parent.GetComponent<Enemy_BOSS_Controller>().hp -= player.GetComponent<PlayerController>().atk;
        }
    }
}
